<template>
  <div class="wrapper">
    <swiper :options="swiperOption">
    <!-- slides -->
    <swiper-slide v-for="item of list" :key="item.id">
        <img class="swiper-image" :src="item.imgUrl" alt="">
    </swiper-slide>
    <!-- Optional controls -->
    <div class="swiper-pagination"  slot="pagination"></div>
  </swiper>
  </div>
</template>
<script>
export default {
  name: 'HomeSwiper',
  props: {
    list: Array
  },
  data () {
    return {
      // 轮播图配置项
      swiperOption: {
        pagination: '.swiper-pagination',
        loop: true
      },
      // swiperList: [{
      //   id: '0001',
      //   imgUrl: 'https://b1-q.mafengwo.net/s18/M00/FD/C9/CoUBYGA0mlqAfiUZACtBqE9zUVA188.png?imageView2%2F2%2Fw%2F1920%2Fq%2F90%2Fformat%2Fjpeg'},
      // {
      //   id: '0002',
      //   imgUrl: 'https://b1-q.mafengwo.net/s18/M00/C5/7C/CoUBYGAzIu-AfMwCACoMZAl4jVU299.png?imageView2%2F2%2Fw%2F1920%2Fq%2F90%2Fformat%2Fjpeg'
      // }]
    }
  }
}
</script>
<style lang="stylus" scoped>
.wrapper >>> .swiper-pagination-bullet-active {
  background: #fff;
}

.wrapper {
  overflow: hidden;
  width: 100%;
  height: 0;
  padding-bottom: 31.25%;
  background-color: #eee;

  .swiper-image {
    width: 100%;
  }
}
</style>
